package com.kaluli.project.repository.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.kaluli.project.domain.entity.KllHupuApiMVO;
import com.kaluli.project.domain.entity.KllProductVo;
import com.kaluli.project.domain.repository.KllHupuApiMVORepository;
import com.kaluli.project.domain.repository.KllProductRepository;
import com.kaluli.system.repository.AbstractRepositorySupport;

@Repository
public class KllHupuApiMVORepositoryImpl extends AbstractRepositorySupport<KllHupuApiMVO> implements KllHupuApiMVORepository {

	@Override
	protected Class<KllHupuApiMVO> getEntityClass() {
		// TODO Auto-generated method stub
		return KllHupuApiMVO.class;
	}


	@Override
	public List<KllHupuApiMVO> findListByjson() {
		StringBuffer sql = new StringBuffer(
				"SELECT kll_hupu_id as id,kll_hupu_title as title , kll_hupu_subtitle as subtitle,kll_hupu_imgpath as img_path,kll_hupu_time as time,kll_hupu_url as detail_url");
		sql.append(" FROM kll_hupu_apicontent ");
		sql.append("  WHERE kll_hupu_status =0 and kll_hupu_type=1 and DATE(kll_hupu_time) = CURDATE() limit 10 ");
		List<KllHupuApiMVO> list = excuteSql(sql.toString());
		return list;
	}
	
	@Override
	public List<KllHupuApiMVO> findListByTime() {
		StringBuffer sql = new StringBuffer(
				"SELECT kll_hupu_id as id,kll_hupu_title as title , kll_hupu_subtitle as subtitle,kll_hupu_imgpath as img_path,kll_hupu_time as time,kll_hupu_url as detail_url");
		sql.append(" FROM kll_hupu_apicontent ");
		sql.append("  WHERE kll_hupu_status =0 and kll_hupu_type=4 order by kll_hupu_time DESC limit 10 ");
		List<KllHupuApiMVO> list = excuteSql(sql.toString());
		return list;
	}

}
